<template>
  <div class="container">
    <el-dialog title="日志详情" :visible.sync="dialogVisible" :close-on-click-modal='false'>
      <el-form :model="dataForm" ref="dataForm" label-width="90px" class="common-dialog-height" @close='closeDialog'>
        <el-form-item label="主键值：" prop="relId">
          <el-input v-model="dataForm.relId"></el-input>
        </el-form-item>
        <el-form-item label="错误原因：" prop="failReason">
          <el-input v-model="dataForm.failReason" type="text"></el-input>
        </el-form-item>
        <el-form-item label="旧数据：" prop="oldValue">
          <el-input v-model="dataForm.oldValue" type="textarea" :rows="3"></el-input>
        </el-form-item>
        <el-form-item label="新数据：" prop="newValue">
          <el-input v-model="dataForm.newValue" type="textarea" :rows="3"></el-input>
        </el-form-item>

      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">关 闭</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
  export default {
    data () {
      return {
        dialogVisible: false,
        dataForm: {
          relId: '',
          oldValue: '',
          newValue: '',
          failReason: '',
        }
      }
    },
    methods: {
      init(data) {
        this.dialogVisible = true
        this.dataForm.relId = data.relId
        this.dataForm.failReason = data.failMsg
        this.dataForm.oldValue = data.oldValue
        this.dataForm.newValue = data.newValue
      },
      closeDialog() {
        this.$refs['dataForm'].resetFields()
      }
    }
  }
</script>
<style>
</style>
